load("//bzl:cpp_library.bzl", "cpp_library")

package(default_visibility = ["//visibility:public"])

cpp_library(
    name = "net_ops",
    srcs = ["NetOps.cpp"],
    hdrs = ["NetOps.h"],
    deps = [
        ":network_socket",
        "//folly:c_portability",
        "//folly:portability",
        "//folly:scope_guard",
        "//folly:utility",
        "//folly/net/detail:socket_file_descriptor_map",
        "//folly/portability:iovec",
        "//folly/portability:sys_types",
        "//folly/portability:time",
        "//folly/portability:windows",
    ],
)

cpp_library(
    name = "net_ops_dispatcher",
    srcs = ["NetOpsDispatcher.cpp"],
    hdrs = ["NetOpsDispatcher.h"],
    deps = [
        ":net_ops",
    ],
)

cpp_library(
    name = "network_socket",
    hdrs = ["NetworkSocket.h"],
    deps = [
        "//folly/net/detail:socket_file_descriptor_map",
        "//folly/portability:windows",
    ],
)

cpp_library(
    name = "tcpinfo",
    srcs = ["TcpInfo.cpp"],
    hdrs = [
        "TcpInfo.h",
        "TcpInfoTypes.h",
    ],
    deps = [
        ":net_ops_dispatcher",
        ":network_socket",
        "//folly:expected",
        "//folly:optional",
        "//folly:string",
        "//folly/portability:sockets",
        "@glog",
    ],
)

cpp_library(
    name = "tcpinfo_dispatcher",
    srcs = ["TcpInfoDispatcher.cpp"],
    hdrs = ["TcpInfoDispatcher.h"],
    deps = [
        ":net_ops_dispatcher",
        ":tcpinfo",
        "//folly:expected",
    ],
)
